import API from "@/utils/request";

export function getPageCart({pageNum,pageSize}){
    return API.get('/cart/page',{
        params:{
            pageNum,
            pageSize
        }
    })
}

export function getAllCart(){
    return API.get('/cart')
}

export function getCartById(id){
    return API.get(`/cart/${id}`)
}

export function saveCart(cart){
    return API.post('/cart',cart)
}

export function updateCart(cart){
    return API.put('/cart',cart)
}

export function removeCart(id){
    return API.delete(`/cart/${id}`)
}